#include <iostream>
using namespace std;

int main()
{
    int n;
    cin>>n;
    int nums[21];
    int dp[21]{0};
    for (int i=0;i<n;i++)
        cin>>nums[i];
    dp[0]=1;
    for (int i=0;i<n;i++)
    {
        for (int j=0;j<i;j++)
        {
            if (nums[i]>nums[j]&&dp[j]+1>dp[i])
                dp[i]=dp[j]+1;
        }
        if (dp[i]==0)
            dp[i]=1;
    }
    cout<<dp[n-1];
}